1. Field of the Invention
The present invention relates to a method and apparatus for rewriting data in a flash memory.
2. Description of the Related Art
Flash memory is a type of electrically erasable programmable read-only memory (EEPROM), in which the rewriting of data involves an erasing process followed by a writing or programming process. The memory cells in a flash memory are organized into small units such as bytes or words, and larger units such as pages or sectors. The erasing process is carried out on one or more pages or sectors at a time, typically by removing electrons from the floating gates of the memory cells; the writing or programming process is carried out one byte or one word at a time, typically by injecting electrons into the floating gates. In a rewriting operation, accordingly, a relatively large number of memory cells are erased simultaneously; then the writing operation is performed a few memory cells at a time within the erased group of memory cells.
The conventional erasing method applies prescribed erasing voltages continuously to the source, control gate, and drain electrodes of the memory cells in the erasing group (e.g., page or sector) for a time sufficient to erase the memory cells completely, so that the erased state can be recognized when the memory cells are read. Similarly, the conventional writing method applies prescribed writing voltages continuously to the source, control gate, and drain electrodes of the memory cells in the writing group (e.g., byte or word) for a time sufficient to program the memory cells completely, so that the programmed state can be recognized when the memory cells are read.
Whereas writing takes only a few tens of microseconds, erasing by the conventional method takes a much longer time, typically several tens of milliseconds. This erasing time is too long for a device such as a contactless smart card, which may need to rewrite data in a time frame shorter than ten milliseconds.